package org.example.Day10.baozi;

public class ThreadTest {
    public static void main(String [] args){
        //三个生产线程一次生产一个
        //两个吃货线程
        Desk desk = new Desk();
        new Thread(()->{
            while(true){
                desk.put();
            }
        },"厨师1").start();
        new Thread(()->{
            while(true){
                desk.put();
            }
        },"厨师2").start();
        new Thread(()->{
            while(true){
                desk.put();
            }
        },"厨师3").start();
        new Thread(()->{
            while(true){
                desk.get();
            }
        },"吃货1").start();

        new Thread(()->{
            while(true){
                desk.get();
            }
        },"吃货2").start();


    }
}
